<%@ page language="java" %>
<%@ page session="true" %>
<%@ page import="java.sql.*,java.io.*,com.jobportal.MyFunctions"%>

<HEAD>


	<script LANGUAGE="Javascript" SRC="Images/validate.js"></script>


	<LINK href="styles.css" type="text/css" rel="stylesheet">

</HEAD>
<BODY class=Grad>
<%

	Connection con=null;
	ResultSet rs=null;
	Statement stmt4=null;
	String userid = request.getParameter("userid");	
	System.out.println("-->"+userid);
	String FilePath = request.getParameter("ResumePath");	
	String FileName = FilePath.substring(FilePath.lastIndexOf("\\"),FilePath.length());

	try{
			
			/* Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
			con = DriverManager.getConnection("jdbc:odbc:jobportal","root",""); */

			Class.forName("com.mysql.jdbc.Driver");
			con = DriverManager.getConnection("jdbc:mysql://localhost:3306/jobmiller","root","root");


			stmt4=con.createStatement();
			String Query4 = "Update professionalinformation set ResumePath = '"+FileName+"' where userid='"+userid+"'";
			System.out.println(Query4);
			int result=stmt4.executeUpdate(Query4);
     		System.out.println(Query4);
			if( result > 0)	{
				%>
					<P align=center><FONT COLOR="green" face="Times new roman">
						<!--<I>Your resume has been updated successfully</I></FONT><BR>-->
						<script>
							alert("Your resume has been updated successfully");
							window.opener.location.reload();
							window.close();
						</script>
						<!--<INPUT TYPE="Button" class="Button" value="Close" onclick="window.close()">-->
					</P>
				<%
			}else{
				%>
					<P align=center><FONT COLOR="green" face="Times new roman">
						<!--<I>Error: Please upload again</I></FONT><BR>-->
						<script>
							alert("Error: Please try again");
							window.opener.location.reload();
							window.close();
						</script>
						<!--<INPUT TYPE="Button" class="Button" value="Close" onclick="window.close()">-->
					</P>
				<%
			}
			stmt4.close();
			con.close();
		}catch(Exception e){
			stmt4.close();
			con.close();
			%><%=e%><%
		}
	
%>
</BODY>


